{% extends "base.html" %}

{% block content %}
{% for post in post_list %}
    <a class="posts" href="{% url 'detail' post.id %}">
        <h1 class="content-subhead">Qin Jin Post</h1>
        <section class="post">
            <header class="post-header">
                {% load staticfiles %}
                <img width="48" height="48" alt="Andrew Wooldridge&#x27;s avatar" class="post-avatar" src="{% static 'images/andrew-avatar.png' %}">
                <h2 class="post-title">{{ post.title }}</h2>
                    <p class="post-meta">
                        Time:  <time class="post-author">{{ post.date_time }}</time> 
                               <span class="post-category post-category-js">{{ post.category }}</span>
                    </p>
            </header>
            <div class="post-description">
                <p>{{ post.content }}</p>
            </div>
        </section>
    </a>
{% endfor %}
{% if post_list.object_list and post_list.paginator.num_pages > 1 %}
      <div>
      <ul class="pager">
      {% if post_list.has_previous %}
        <li><a href="?page={{ post_list.previous_page_number }}">上一页</a></li>
      {% endif %}

      {% if post_list.has_next %}
        <li><a href="?page={{ post_list.next_page_number }}">下一页</a></li>
      {% endif %}
      </ul>
      </div>
    {% endif %}
{% endblock %}
